package main

import (
	"fmt"
	"log"
	"sync"

	"github.com/imroc/req/v3"
)

func getFlog() {
	client := req.C()
	resp, err := client.R().Get("http://localhost:8080/haha")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(resp.String())
}

func main() {
	ch := make(chan int, 100)
	var wg sync.WaitGroup
	for i := range 10000 {
		ch <- 1
		wg.Add(1)
		go func(i int) {
			fmt.Println(i)
			getFlog()
			wg.Done()
			<-ch
		}(i)

	}
	wg.Wait()
}
